package com.byf.product.controller;

import com.byf.common.core.domain.Result;
import com.byf.common.security.annotation.RequiresPermissions;
import com.byf.product.config.ProductThreadPoolConfig;
import com.byf.product.service.ItemInfoService;
import com.byf.product.vo.ItemInfoVo;
import lombok.SneakyThrows;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.byf.common.core.domain.Result.success;

@RestController
@RequestMapping("/itemInfo")
public class ItemInfoController {
    @Autowired
    private ItemInfoService itemInfoService;

    /**
     * 获取商品规格与包装
     */
    @SneakyThrows
    @RequestMapping(value = "/{skuId}")
    public Result getItemInfo(@PathVariable("skuId") Long skuId)
    {
        ItemInfoVo itemInfoVo = itemInfoService.getItemInfo(skuId);
        return success(itemInfoVo);
    }
}
